<html>
  <head>
    <title>js_defer example</title>
    <!-- Ensure that the insertion order in the list is maintained when some script is inserted on the page via document.write. -->
  </head>
  <body>
    <script type="text/javascript">
      var list = [];
    </script>
    <script type="text/javascript">
      list.push(1);
    </script>
    <script type="text/javascript">
      document.write('<scr' + 'ipt>' + 'list.push(2);' + '<' +'/scr' + 'ipt>');
    </script>
    <script type="text/javascript">
      list.push(3);
    </script>
    <div id="listDiv"></div>
    <script type="text/javascript" >
      var listDiv = document.getElementById("listDiv");
      listDiv.innerHTML = list.join();
    </script>
  </body>
</html>
